home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
001-100
/
001-025
/
024
/
csh
/
main.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-17
|
763b
|
51 lines
/*
* MAIN.C
*
* Matthew Dillon, 28 Apr 1986
*
* el main routine.
*/
#include "shell.h"
char Inline[256];
main(argc, argv)
char *argv[];
{
char *prompt;
int i;
init_vars();
init();
for (i = 1; i < argc; ++i) {
strcpy (Inline, "source ");
strcat (Inline, argv[i]);
do_source (Inline, 0);
}
for (;;) {
if ((prompt = get_var (LEVEL_SET, V_PROMPT)) == NULL)
prompt = "echo -n \"% \"";
++H_stack;
exec_command (prompt);
--H_stack;
fflush (stdout);
if (gets (Inline) == NULL)
exit (0);
if (*Inline)
exec_command (Inline);
}
}
init()
{
}
init_vars()
{
set_var (LEVEL_SET, V_PROMPT, "echo -n \"% \"");
set_var (LEVEL_SET, V_HIST, "20");
}